<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<meta name="GENERATOR" content="PasDoc 0.9.0">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>blcksock</title>
<link rel="StyleSheet" type="text/css" href="pasdoc.css">
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#FF0000">
<h1 class="unit">Unit blcksock</h1>
<table class="sections">
<tr>
<td><a class="section"  href="#@Description">Description</a></td><td><a class="section"  href="#@Uses">uses</a></td><td><a class="section"  href="#@Classes">Classes, Interfaces, Objects and Records</a></td><td>Functions and Procedures</td><td><a class="section"  href="#@Types">Types</a></td><td><a class="section"  href="#@Constants">Constants</a></td><td><a class="section"  href="#@Variables">Variables</a></td></tr></table>
<a name="@Description"></a><h2 class="description">Description</h2>
<p>
Synapse's library core</p>
<p>


<p>Core with implementation basic socket classes.</p>
<a name="@Uses"></a><h2 class="uses">uses</h2>
<ul class="useslist"><li>SysUtils</li><li>Classes</li><li>synafpc</li><li>synsock</li><li><a   href="synautil.html">synautil</a></li><li><a   href="synacode.html">synacode</a></li><li><a   href="synaip.html">synaip</a></li></ul><h2 class="overview">Overview</h2>
<a name="@Classes"></a><h3 class="cio">Classes, Interfaces, Objects and Records</h3>
<table class="classestable">
<tr class="listheader">
<th class="itemname">Name</th>
<th class="itemdesc">Description</th>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold"  href="blcksock.ESynapseError.html"><code>ESynapseError</code></a></td>
<td class="itemdesc">Exception clas used by Synapse</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold"  href="blcksock.TSynaOption.html"><code>TSynaOption</code></a></td>
<td class="itemdesc">this object is used for remember delayed socket option set.</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold"  href="blcksock.TBlockSocket.html"><code>TBlockSocket</code></a></td>
<td class="itemdesc">Basic IP object.</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold"  href="blcksock.TSocksBlockSocket.html"><code>TSocksBlockSocket</code></a></td>
<td class="itemdesc">Support for SOCKS4 and SOCKS5 proxy</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold"  href="blcksock.TTCPBlockSocket.html"><code>TTCPBlockSocket</code></a></td>
<td class="itemdesc">Implementation of TCP socket.</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold"  href="blcksock.TDgramBlockSocket.html"><code>TDgramBlockSocket</code></a></td>
<td class="itemdesc">Datagram based communication</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold"  href="blcksock.TUDPBlockSocket.html"><code>TUDPBlockSocket</code></a></td>
<td class="itemdesc">Implementation of UDP socket.</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold"  href="blcksock.TICMPBlockSocket.html"><code>TICMPBlockSocket</code></a></td>
<td class="itemdesc">Implementation of RAW ICMP socket.</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold"  href="blcksock.TRAWBlockSocket.html"><code>TRAWBlockSocket</code></a></td>
<td class="itemdesc">Implementation of RAW socket.</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold"  href="blcksock.TCustomSSL.html"><code>TCustomSSL</code></a></td>
<td class="itemdesc">Parent class for all SSL plugins.</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold"  href="blcksock.TSSLNone.html"><code>TSSLNone</code></a></td>
<td class="itemdesc">Default SSL plugin with no SSL support.</td>
</tr>
<tr class="list2">
<td class="itemname">record&nbsp;<a class="bold"  href="blcksock.TIPHeader.html"><code>TIPHeader</code></a></td>
<td class="itemdesc">Record with definition of IP packet header.</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold"  href="blcksock.TSynaClient.html"><code>TSynaClient</code></a></td>
<td class="itemdesc">Parent class of application protocol implementations.</td>
</tr>
</table>
<a name="@Types"></a><h3 class="summary">Types</h3>
<table class="summary">
<tr class="list">
<td class="itemcode"><code><b><a   href="blcksock.html#THookSocketReason">THookSocketReason</a></b> = (...);</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a   href="blcksock.html#THookSocketStatus">THookSocketStatus</a></b> = procedure(Sender: TObject; Reason: <a   href="blcksock.html#THookSocketReason">THookSocketReason</a>; const Value: string) of object;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a   href="blcksock.html#THookDataFilter">THookDataFilter</a></b> = procedure(Sender: TObject; var Value: string) of object;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a   href="blcksock.html#THookCreateSocket">THookCreateSocket</a></b> = procedure(Sender: TObject) of object;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a   href="blcksock.html#THookMonitor">THookMonitor</a></b> = procedure(Sender: TObject; Writing: Boolean; const Buffer: TMemory; Len: Integer) of object;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a   href="blcksock.html#THookAfterConnect">THookAfterConnect</a></b> = procedure(Sender: TObject) of object;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a   href="blcksock.html#THookHeartbeat">THookHeartbeat</a></b> = procedure(Sender: TObject) of object;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a   href="blcksock.html#TSocketFamily">TSocketFamily</a></b> = (...);</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a   href="blcksock.html#TSocksType">TSocksType</a></b> = (...);</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a   href="blcksock.html#TSSLType">TSSLType</a></b> = (...);</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a   href="blcksock.html#TSynaOptionType">TSynaOptionType</a></b> = (...);</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a   href="blcksock.html#TSSLClass">TSSLClass</a></b> = class of <a   href="blcksock.TCustomSSL.html">TCustomSSL</a>;</code></td>
</tr>
</table>
<a name="@Constants"></a><h3 class="summary">Constants</h3>
<table class="summary">
<tr class="list">
<td class="itemcode"><code><b><a   href="blcksock.html#SynapseRelease">SynapseRelease</a></b> = '38b8';</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a   href="blcksock.html#cLocalhost">cLocalhost</a></b> = '127.0.0.1';</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a   href="blcksock.html#cAnyHost">cAnyHost</a></b> = '0.0.0.0';</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a   href="blcksock.html#cBroadcast">cBroadcast</a></b> = '255.255.255.255';</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a   href="blcksock.html#c6Localhost">c6Localhost</a></b> = '::1';</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a   href="blcksock.html#c6AnyHost">c6AnyHost</a></b> = '::0';</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a   href="blcksock.html#c6Broadcast">c6Broadcast</a></b> = 'ffff::1';</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a   href="blcksock.html#cAnyPort">cAnyPort</a></b> = '0';</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a   href="blcksock.html#CR">CR</a></b> = #$0d;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a   href="blcksock.html#LF">LF</a></b> = #$0a;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a   href="blcksock.html#CRLF">CRLF</a></b> = <a   href="blcksock.html#CR">CR</a> + <a   href="blcksock.html#LF">LF</a>;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a   href="blcksock.html#c64k">c64k</a></b> = 65536;</code></td>
</tr>
</table>
<a name="@Variables"></a><h3 class="summary">Variables</h3>
<table class="summary">
<tr class="list">
<td class="itemcode"><code><b><a   href="blcksock.html#SSLImplementation">SSLImplementation</a></b>: <a   href="blcksock.html#TSSLClass">TSSLClass</a> = <a   href="blcksock.TSSLNone.html">TSSLNone</a>;</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Types</h3>
<table class="detail">
<tr class="list">
<td class="itemcode"><a name="THookSocketReason"></a><code><b>THookSocketReason</b> = (...);</code></td>
</tr>
</table>
<p>
Types of OnStatus events</p>
<ul>
<li>
HR_ResolvingBegin: Resolving is begin. Resolved IP and port is in parameter in format like: 'localhost.somewhere.com:25'.</li>
<li>
HR_ResolvingEnd: Resolving is done. Resolved IP and port is in parameter in format like: 'localhost.somewhere.com:25'. It is always same as in HR_ResolvingBegin!</li>
<li>
HR_SocketCreate: Socket created by CreateSocket method. It reporting Family of created socket too!</li>
<li>
HR_SocketClose: Socket closed by CloseSocket method.</li>
<li>
HR_Bind: Socket binded to IP and Port. Binded IP and Port is in parameter in format like: 'localhost.somewhere.com:25'.</li>
<li>
HR_Connect: Socket connected to IP and Port. Connected IP and Port is in parameter in format like: 'localhost.somewhere.com:25'.</li>
<li>
HR_CanRead: Called when CanRead method is used with <code>True</code> result.</li>
<li>
HR_CanWrite: Called when CanWrite method is used with <code>True</code> result.</li>
<li>
HR_Listen: Socket is swithed to Listen mode. (TCP socket only)</li>
<li>
HR_Accept: Socket Accepting client connection. (TCP socket only)</li>
<li>
HR_ReadCount: report count of bytes readed from socket. Number is in parameter string. If you need is in integer, you must use StrToInt function!</li>
<li>
HR_WriteCount: report count of bytes writed to socket. Number is in parameter string. If you need is in integer, you must use StrToInt function!</li>
<li>
HR_Wait: If is limiting of bandwidth on, then this reason is called when sending or receiving is stopped for satisfy bandwidth limit. Parameter is count of waiting milliseconds.</li>
<li>
HR_Error: report situation where communication error occured. When raiseexcept is <code>True</code>, then exception is called after this Hook reason.</li>
</ul>
<table class="detail">
<tr class="list">
<td class="itemcode"><a name="THookSocketStatus"></a><code><b>THookSocketStatus</b> = procedure(Sender: TObject; Reason: <a   href="blcksock.html#THookSocketReason">THookSocketReason</a>; const Value: string) of object;</code></td>
</tr>
</table>
<p>
Procedural type for OnStatus event. Sender is calling TBlockSocket object, Reason is one of set Status events and value is optional data.</p>
<table class="detail">
<tr class="list">
<td class="itemcode"><a name="THookDataFilter"></a><code><b>THookDataFilter</b> = procedure(Sender: TObject; var Value: string) of object;</code></td>
</tr>
</table>
<p>
This procedural type is used for DataFilter hooks.</p>
<table class="detail">
<tr class="list">
<td class="itemcode"><a name="THookCreateSocket"></a><code><b>THookCreateSocket</b> = procedure(Sender: TObject) of object;</code></td>
</tr>
</table>
<p>
This procedural type is used for hook OnCreateSocket. By this hook you can insert your code after initialisation of socket. (you can set special socket options, etc.)</p>
<table class="detail">
<tr class="list">
<td class="itemcode"><a name="THookMonitor"></a><code><b>THookMonitor</b> = procedure(Sender: TObject; Writing: Boolean; const Buffer: TMemory; Len: Integer) of object;</code></td>
</tr>
</table>
<p>
This procedural type is used for monitoring of communication.</p>
<table class="detail">
<tr class="list">
<td class="itemcode"><a name="THookAfterConnect"></a><code><b>THookAfterConnect</b> = procedure(Sender: TObject) of object;</code></td>
</tr>
</table>
<p>
This procedural type is used for hook OnAfterConnect. By this hook you can insert your code after TCP socket has been sucessfully connected.</p>
<table class="detail">
<tr class="list">
<td class="itemcode"><a name="THookHeartbeat"></a><code><b>THookHeartbeat</b> = procedure(Sender: TObject) of object;</code></td>
</tr>
</table>
<p>
This procedural type is used for hook OnHeartbeat. By this hook you can call your code repeately during long socket operations. You must enable heartbeats by <code>HeartbeatRate</code> property!</p>
<table class="detail">
<tr class="list">
<td class="itemcode"><a name="TSocketFamily"></a><code><b>TSocketFamily</b> = (...);</code></td>
</tr>
</table>
<p>
Specify family of socket.</p>
<ul>
<li>
SF_Any: Default mode. Socket family is defined by target address for connection. It allows instant access to IPv4 and IPv6 nodes. When you need IPv6 address as destination, then is used IPv6 mode. othervise is used IPv4 mode. However this mode not working properly with preliminary IPv6 supports!</li>
<li>
SF_IP4: Turn this class to pure IPv4 mode. This mode is totally compatible with previous Synapse releases.</li>
<li>
SF_IP6: Turn to only IPv6 mode.</li>
</ul>
<table class="detail">
<tr class="list">
<td class="itemcode"><a name="TSocksType"></a><code><b>TSocksType</b> = (...);</code></td>
</tr>
</table>
<p>
specify possible values of SOCKS modes.</p>
<ul>
<li>
ST_Socks5: </li>
<li>
ST_Socks4: </li>
</ul>
<table class="detail">
<tr class="list">
<td class="itemcode"><a name="TSSLType"></a><code><b>TSSLType</b> = (...);</code></td>
</tr>
</table>
<p>
Specify requested SSL/TLS version for secure connection.</p>
<ul>
<li>
LT_all: </li>
<li>
LT_SSLv2: </li>
<li>
LT_SSLv3: </li>
<li>
LT_TLSv1: </li>
<li>
LT_TLSv1_1: </li>
<li>
LT_SSHv2: </li>
</ul>
<table class="detail">
<tr class="list">
<td class="itemcode"><a name="TSynaOptionType"></a><code><b>TSynaOptionType</b> = (...);</code></td>
</tr>
</table>
<p>
Specify type of socket delayed option.</p>
<ul>
<li>
SOT_Linger: </li>
<li>
SOT_RecvBuff: </li>
<li>
SOT_SendBuff: </li>
<li>
SOT_NonBlock: </li>
<li>
SOT_RecvTimeout: </li>
<li>
SOT_SendTimeout: </li>
<li>
SOT_Reuse: </li>
<li>
SOT_TTL: </li>
<li>
SOT_Broadcast: </li>
<li>
SOT_MulticastTTL: </li>
<li>
SOT_MulticastLoop: </li>
</ul>
<table class="detail">
<tr class="list">
<td class="itemcode"><a name="TSSLClass"></a><code><b>TSSLClass</b> = class of <a   href="blcksock.TCustomSSL.html">TCustomSSL</a>;</code></td>
</tr>
</table>
&nbsp;<h3 class="detail">Constants</h3>
<table class="detail">
<tr class="list">
<td class="itemcode"><a name="SynapseRelease"></a><code><b>SynapseRelease</b> = '38b8';</code></td>
</tr>
</table>
&nbsp;<table class="detail">
<tr class="list">
<td class="itemcode"><a name="cLocalhost"></a><code><b>cLocalhost</b> = '127.0.0.1';</code></td>
</tr>
</table>
&nbsp;<table class="detail">
<tr class="list">
<td class="itemcode"><a name="cAnyHost"></a><code><b>cAnyHost</b> = '0.0.0.0';</code></td>
</tr>
</table>
&nbsp;<table class="detail">
<tr class="list">
<td class="itemcode"><a name="cBroadcast"></a><code><b>cBroadcast</b> = '255.255.255.255';</code></td>
</tr>
</table>
&nbsp;<table class="detail">
<tr class="list">
<td class="itemcode"><a name="c6Localhost"></a><code><b>c6Localhost</b> = '::1';</code></td>
</tr>
</table>
&nbsp;<table class="detail">
<tr class="list">
<td class="itemcode"><a name="c6AnyHost"></a><code><b>c6AnyHost</b> = '::0';</code></td>
</tr>
</table>
&nbsp;<table class="detail">
<tr class="list">
<td class="itemcode"><a name="c6Broadcast"></a><code><b>c6Broadcast</b> = 'ffff::1';</code></td>
</tr>
</table>
&nbsp;<table class="detail">
<tr class="list">
<td class="itemcode"><a name="cAnyPort"></a><code><b>cAnyPort</b> = '0';</code></td>
</tr>
</table>
&nbsp;<table class="detail">
<tr class="list">
<td class="itemcode"><a name="CR"></a><code><b>CR</b> = #$0d;</code></td>
</tr>
</table>
&nbsp;<table class="detail">
<tr class="list">
<td class="itemcode"><a name="LF"></a><code><b>LF</b> = #$0a;</code></td>
</tr>
</table>
&nbsp;<table class="detail">
<tr class="list">
<td class="itemcode"><a name="CRLF"></a><code><b>CRLF</b> = <a   href="blcksock.html#CR">CR</a> + <a   href="blcksock.html#LF">LF</a>;</code></td>
</tr>
</table>
&nbsp;<table class="detail">
<tr class="list">
<td class="itemcode"><a name="c64k"></a><code><b>c64k</b> = 65536;</code></td>
</tr>
</table>
&nbsp;<h3 class="detail">Variables</h3>
<table class="detail">
<tr class="list">
<td class="itemcode"><a name="SSLImplementation"></a><code><b>SSLImplementation</b>: <a   href="blcksock.html#TSSLClass">TSSLClass</a> = <a   href="blcksock.TSSLNone.html">TSSLNone</a>;</code></td>
</tr>
</table>
<p>
Selected SSL plugin. Default is <a class="normal" href="blcksock.TSSLNone.html">TSSLNone</a>.

<p>Do not change this value directly!!!

<p>Just add your plugin unit to your project uses instead. Each plugin unit have initialization code what modify this variable.</p>
<hr noshade size="1"><span class="appinfo"><em>Generated by <a  target="_parent" href="http://pasdoc.sourceforge.net/">PasDoc 0.9.0</a> on 2007-12-20 22:45:43</em>
</span>
</body></html>
